#pragma once
#include <iostream>
#include <ctime>
#include <stdio.h>
#include <stdarg.h>
#include <cstring>

#define DEBUG 0
#define NORMAL 1
#define WARING 2
// #define ERROR 3
#define FATAL 4

#define FILE_NAME "./log.txt"

#define ENABLE_LOG
extern const char *gLevelMap[];

// 日志函数
void LogMessage(int level, const char *file, int line, const char *format, ...);

#ifdef ENABLE_LOG
    #define LOG(level, format, ...) LogMessage(level, __FILE__, __LINE__, format, ##__VA_ARGS__)
#elif
    #define LOG(level, format, ...) // nothing todo
#endif